package com.xiaochong.tir.trades.mqrevTrades;

import com.xiaochong.tir.trades.component.DataSaveHbaseCommon;
import com.xiaochong.tir.trades.rabbit.BinanceMqQueue;
import com.xiaochong.tir.trades.rabbit.HuobiproMqQueue;
import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * @Description: binance消费
 * @Author: org
 * @CreateDate: 2018/7/6 16:51
 */
@Component
public class BinanceRevTrades {
    @Resource
    private DataSaveHbaseCommon mqDataSaveHbaseCommon;

    @RabbitListener(queues = BinanceMqQueue.QUEUE_TRADES_BINANCE_BTC)
    @RabbitHandler
    public void processBinanceBtc(byte[] body) {
        mqDataSaveHbaseCommon.MqDataSaveTradesAction(body);
    }

    @RabbitListener(queues = BinanceMqQueue.QUEUE_TRADES_BINANCE_ETH)
    @RabbitHandler
    public void processBinanceEth(byte[] body) {
        mqDataSaveHbaseCommon.MqDataSaveTradesAction(body);
    }

    @RabbitListener(queues = BinanceMqQueue.QUEUE_TRADES_BINANCE_USDT)
    @RabbitHandler
    public void processBinanceUsdt(byte[] body) {
        mqDataSaveHbaseCommon.MqDataSaveTradesAction(body);
    }

    @RabbitListener(queues = BinanceMqQueue.QUEUE_TRADES_BINANCE_BNB)
    @RabbitHandler
    public void processBinanceBnb(byte[] body) {
        mqDataSaveHbaseCommon.MqDataSaveTradesAction(body);
    }
}
